//
//  PublicAccountTypeViewCell.m
//  SouthChina
//
//  Created by zorro on 15/6/15.
//  Copyright (c) 2015年 科创. All rights reserved.
//

#import "PublicAccountTypeViewCell.h"
#import "PublicAccount.h"
@implementation PublicAccountTypeViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

//image是四张图片组合而成
-(void)SetCellHeadImage:(NSArray*)publiccountarr
{
    CGRect R[4];
    
    R[0] = CGRectMake(3, 3, 19, 19);
    R[1] = CGRectMake(25, 3, 19, 19);
    R[2] = CGRectMake(3, 25, 19, 19);
    R[3] = CGRectMake(25, 25, 19, 19);
      for (NSUInteger i = 0;i<4; i++) {
        UIImageView *imageCell = [[UIImageView alloc] initWithFrame:R[i]];
       imageCell.layer.masksToBounds= YES;
       imageCell.layer.cornerRadius = 3;
        if(publiccountarr.count>=i+1)
        {
            
            PublicAccount *publicAcnt = [publiccountarr objectAtIndex:i];
            NSURL *url= [NSURL URLWithString: [publicAcnt.headImg hasPrefix:@"http"]?publicAcnt.headImg:[NSString stringWithFormat:@"%@%@",DE.fileEngineeUrl,publicAcnt.headImg]];
            [imageCell setImageWithURL:url placeholderImage:[UIImage imageNamed:@"empty_photo"]];
        }
        else
            imageCell.image = [UIImage imageNamed:@"empty_photo"];
        [_imgHead addSubview:imageCell];
    }
   
}
@end
